package com.ljh.onlinetest.service;

import com.github.pagehelper.PageInfo;
import com.ljh.onlinetest.domain.ExamPaperAnswer;
import com.ljh.onlinetest.domain.ExamPaperAnswerInfo;
import com.ljh.onlinetest.domain.User;
import com.ljh.onlinetest.viewmodel.admin.paper.ExamPaperAnswerPageRequestVM;
import com.ljh.onlinetest.viewmodel.student.exam.ExamPaperSubmitVM;
import com.ljh.onlinetest.viewmodel.student.exampaper.ExamPaperAnswerPageVM;

import java.util.List;

/**
 * @author ljh
 * @ClassName ExamPaperAnswerService.java
 * @createTime 2022年02月22日
 */
public interface ExamPaperAnswerService extends BaseService<ExamPaperAnswer> {
    /**
     * 学生考试记录分页
     * @param model
     * @return
     */
    PageInfo<ExamPaperAnswer> page(ExamPaperAnswerPageRequestVM model);

    Integer selectAllCount();

    /**
     * 计算考试提交结果(不入库)
     * @param examPaperSubmitVM
     * @param user
     * @return
     */
    ExamPaperAnswerInfo calculateExamPaperAnswer(ExamPaperSubmitVM examPaperSubmitVM, User user);

    /**
     * 试卷答题信息转成ViewModel 传给前台
     * @param id
     * @return
     */
    ExamPaperSubmitVM examPaperAnswerToVM(Integer id);

    /**
     * 考试记录分页
     * @param model
     * @return
     */
    PageInfo<ExamPaperAnswer> studentPage(ExamPaperAnswerPageVM model);

    /**
     * 试卷批改
     * @param examPaperSubmitVM
     * @return
     */
    String judge(ExamPaperSubmitVM examPaperSubmitVM);
}
